﻿<html>
<head>
    <title>smsx.cab</title>
    <!-- MeadCo ScriptX -->
    <object id="factory" style="display: none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
        codebase="smsx.cab#Version=6,4,438,06">
    </object>
    <script defer>
        function window.onload() {
            if (!factory.object) {
                alert("打印控件没有正确安装!");
                return;
            } else {
                // -- advanced features
                factory.printing.SetMarginMeasure(2); // measure margins in inches
                factory.printing.printer = "HP DeskJet 870C";
                factory.printing.paperSize = "A4";
                factory.printing.paperSource = "Manual feed";
                factory.printing.collate = true;
                factory.printing.copies = 2;
                factory.printing.SetPageRange(false, 1, 3); // need pages from 1 to 3

                // -- basic features
                factory.printing.header = "This is MeadCo";
                factory.printing.footer = "Printing by ScriptX";
                factory.printing.portrait = true;
                factory.printing.leftMargin = 5.0;
                factory.printing.topMargin = 5.0;
                factory.printing.rightMargin = 5.0;
                factory.printing.bottomMargin = 5.0;
            }
        }
    </script>
    <script language="javascript">
        function printTure() //打印函数
        {
            document.all("dayindiv").style.display = "none"; //隐藏按钮
            factory.printing.Print(true); //调用控件打印
            document.all("dayindiv").style.display = ""; //显示
        }
        function Print(frame) {
            factory.printing.Print(true, frame) // print with prompt
        }
    </script>
</head>
<body>
    <div>
        <pre>
    我被打印出来了:
    十二因缘的解脱观
</pre>
    </div>
    <div>
        <p style="page-break-before: always">
            我在另外一页</p>
    </div>
    <div align="center" id="dayindiv" name="dayindiv">
        <input type="button" value="打印本页" onclick="printTure()">
        <input type="button" value="页面设置" onclick="factory.printing.PageSetup()">
        <input type="button" value="打印预览" onclick="factory.printing.Preview()">
    </div>
</body>
</html>